package cn.csc.module.member.api.userrole;

/**
 * @author liuchuang
 * @version 1.0
 * @modify
 * @since 2024/11/27 18:10
 */

import cn.csc.framework.common.pojo.CommonResult;
import cn.csc.module.member.enums.ApiConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigInteger;

/**
 * 会员和角色关联表的 API 接口
 *
 * @author
 */
@FeignClient(name = ApiConstants.NAME) // TODO fallbackFactory =
@Api("RPC 服务 - 会员用户")
public interface MemberUserRoleApi {

    String PREFIX = ApiConstants.PREFIX + "/userrole";

    @GetMapping(PREFIX + "/relate")
    @ApiOperation("给用户关联用户角色")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "userId", value = "用户编号", required = true, example = "1024"),
        @ApiImplicitParam(name = "roleCode", value = "角色权限字符串", required = true, example = "purchaser")
    })
    CommonResult<Boolean> relate(@RequestParam("userId") BigInteger userId, @RequestParam("roleCode") String roleCode);


}
